package cn.nju.zyy.share.atomic;

public class SerialNumberGenerator {
	private static volatile int serialNumber = 0;
	
	// should to be synchronized
	public static int nextSerialNumber() {
		return serialNumber++;		// Not thread-safe
	}

}
